package com.project.bean;

import java.time.LocalDate;

/**
 * 项目进度实体类
 */
public class ProcessBean {
    /**进度id*/
    private int id;
    /**该员工在该项目的开始时间*/
    private LocalDate startDate = LocalDate.now();
    /**该员工在该项目的结束时间*/
    private LocalDate endDate;
    private String endString;
    /**员工对象*/
    private EmployeeBean emBean;
    /**项目对象*/
    private ProgramBean programBean;

    public String getEndString() {
        if (endDate == null) {
            return "未完成";
        }
        return endDate.toString();
    }

    public ProcessBean() {
    }

    public ProcessBean( String endString,
                       int emId, int proId) {
        this.endString = endString;
        this.emBean = new EmployeeBean();
        emBean.setId(emId);
        this.programBean = new ProgramBean();
        programBean.setId(proId);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDate startDate) {
        this.startDate = startDate;
    }

    public LocalDate getEndDate() {
        return endDate;
    }

    public void setEndDate(LocalDate endDate) {
        this.endDate = endDate;
    }

    public void setEndString(String endString) {
        this.endString = endString;
    }

    public EmployeeBean getEmBean() {
        return emBean;
    }

    public void setEmBean(EmployeeBean emBean) {
        this.emBean = emBean;
    }

    public ProgramBean getProgramBean() {
        return programBean;
    }

    public void setProgramBean(ProgramBean programBean) {
        this.programBean = programBean;
    }

    @Override
    public String toString() {
        return "ProcessBean{" +
                "id=" + id +
                ", startDate=" + startDate +
                ", endDate=" + endDate +
                ", endString='" + endString + '\'' +
                ", emBean=" + emBean +
                ", programBean=" + programBean +
                "}\n";
    }
}
